# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=libspatialite
pkgver=5.1.0
pkgrel=0
pkgdesc="SpatiaLite extends the SQLite core to support fully fledged Spatial SQL capabilities."
url="https://www.gaia-gis.it/fossil/libspatialite/index"
arch="all"
license="MPL-1.1"
depends_dev="
	geos-dev
	librttopo-dev
	libxml2-dev
	minizip-dev
	proj-dev
	sqlite-dev
	"
makedepends="$depends_dev"
subpackages="$pkgname-dev"
source="https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-$pkgver.tar.gz"
options="!check" # Tests fail on non-x86

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--prefix=/usr \
		--build=$CBUILD \
		--host=$CHOST \
		--enable-freexl=no \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
2745b373e31cea58623224def6090c491b58409803bb71231450dfa2cfdf3aafc3fc6f680585d55d085008f8cf362c3062ae67ffc7d80257775a22eb81ef1e57  libspatialite-5.1.0.tar.gz
"
